const OpenAI = require('openai')

const openaiRole = new OpenAI({
    baseURL: 'https://api.deepseek.com',
    apiKey: 'sk-96f82303288c450a8f847d5b2edf257a'
});

async function getAIData(data) {
    console.log('data');
    console.log('data:', data);
    console.log('data');
    let content = ''
    return await openaiRole.chat.completions.create({
        messages: [
            {role: "system", content: "You are a helpful assistant."},
        ],
        stream: true,
        model: "deepseek-chat",
    });

    // return {
    //     code: 200,
    //     msg: '请求成功',
    //     data: content
    // }
    // console.log(completion.choices[0].message.content);

}

exports.getAIData = getAIData